package com.keymozy.controller;

import com.keymozy.service.PositionService;
import com.keymozy.state.Code;
import com.keymozy.state.RespData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/pos")
@CrossOrigin
public class PositionController {
    @Autowired
    private PositionService positionService;

    @GetMapping("/getAll")
    public RespData getAll(){
        return new RespData(Code.SUCCESS_POSITION_1,positionService.getAll());
    }
}
